<template>
  <div class="totalProductionChart" ref="totalProductionChart">

  </div>
</template>

<script>
  var echarts = require('echarts')
  export default {
    data() {
      return {
        data: [
          { value: 400, name: '构建一系列' },
          { value: 735, name: '构建二系列' },
          { value: 580, name: '构建三系列' },
          { value: 484, name: '构建四系列' },
          { value: 300, name: '构建五系列' }
        ]
      }
    },
    methods: {
      totalProductionChart() {
        var myChart = echarts.init(this.$refs.totalProductionChart)
        myChart.setOption({
          title: {
            text: '生产中各产品数量统计',
            subtext: '纯属虚构',
            left: 'center'
          },
          tooltip: {
            trigger: 'item'
          },
          legend: {
            top: '15%',
            left: 'left',
          },
          series: [
            {
              name: '访问来源',
              type: 'pie',
              radius: ['20%', '30%'],
              data: this.data,
              emphasis: {
                itemStyle: {
                  shadowBlur: 10,
                  shadowOffsetX: 0,
                  shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
              }
            }
          ]
        })
      }
    },
    mounted() {
      this.totalProductionChart()
    },
  }

</script>
<style lang='scss' scoped>
  div {
    width: 100%;
    height: 300px;
  }
</style>